<!--
 Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>Trade Account information</title>
    <link rel="stylesheet" href="style.css" type="text/css" />
</h:head>
<h:body bgcolor="#ffffff" link="#000099" vlink="#000099">
<h:form>
<table height="54">
    <tbody>
        <tr>
            <td bgcolor="#c93333" align="left" width="640" height="10" colspan="5"><b><font
                color="#ffffff">DayTrader Account</font></b></td>
            <td align="center" bgcolor="#000000" width="100" height="10"><font
                color="#ffffff"><b>DayTrader</b></font></td>
        </tr>
        <tr align="left">
            <td><b><h:outputLink value="tradehome.faces">Home</h:outputLink></b><b> </b></td>
            <td><b><h:outputLink value="account.faces">Account</h:outputLink></b><b> </b></td>
            <td><b><h:outputLink value="portfolio.faces">Portfolio</h:outputLink></b><b> </b></td>
            <td><b><h:outputLink value="quote.faces">Quotes/Trade</h:outputLink></b></td>
            <td><b><h:commandLink action="#{tradeapp.logout}">Logoff</h:commandLink></b></td>
            <td></td>
        </tr>
        <tr>
            <td align="right" colspan="6">
            <hr/>
            <font color="#ff0000" size="-2"><h:outputLabel value="#{accountdata.currentTime}" color="#ff0000" /></font></td>
        </tr>
       
        <tr>
            <td colspan="6" bgcolor="#ff0000"><blink><b><font color="#ffffff">Alert:
            The following Order(s) have completed.</font></b></blink></td>
        </tr>
        <tr align="center">
            <td colspan="6">
            <h:dataTable id="orders" value="#{accountdata.closedOrders}"
            var="item" border="1">
            <f:facet name="header">
                <h:outputText value="Alert: The following Order(s) have completed."
                    color="#ff0000" />
            </f:facet>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="order id" />
                </f:facet>
                <h:outputText value="#{item.orderID}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="order status" />
                </f:facet>
                <h:outputText value="#{item.orderStatus}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="creation date" />
                </f:facet>
                <h:outputText value="#{item.openDate}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="completion date" />
                </f:facet>
                <h:outputText value="#{item.completionDate}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="txn fee" />
                </f:facet>
                <h:outputText value="#{item.orderFee}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="type" />
                </f:facet>
                <h:outputText value="#{item.orderType}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="symbol" />
                </f:facet>
                <h:outputText value="#{item.symbol}"></h:outputText>
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="quantity" />
                </f:facet>
                <h:outputText value="#{item.quantity}"></h:outputText>
            </h:column>
        </h:dataTable>
            </td>
        </tr>
       
    </tbody>
</table>
<table width="620">
    <tbody>
        <tr>
            <td valign="top" width="643">
            <table width="100%">
                <tbody>
                    <tr>
                        <td colspan="8"><font color="#ff0000">result</font></td>
                    </tr>
                    <tr>
                        <td colspan="8" align="left" bgcolor="#cccccc"><b>Account
                        Information</b></td>
                    </tr>
                    <tr>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">account
                        created:</a></td>
                        <td align="left" valign="bottom" colspan="2"><h:outputText value="#{accountdata.creationDate}" /></td>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">last
                        login: </a></td>
                        <td align="left" valign="bottom" colspan="3"><h:outputText value="#{accountdata.lastLogin}" /></td>
                        <td align="left" valign="bottom"></td>
                    </tr>
                    <tr>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">account
                        ID</a></td>
                        <td valign="bottom"><h:outputText value="#{accountdata.accountID}" /></td>
                        <td valign="bottom"></td>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">total
                        logins: </a></td>
                        <td valign="bottom"><h:outputText value="#{accountdata.loginCount}" /></td>
                        <td valign="bottom"></td>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">cash
                        balance: </a></td>
                        <td valign="bottom"><h:outputText value="#{accountdata.balance}" /></td>
                    </tr>
                    <tr>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">user
                        ID:</a></td>
                        <td valign="bottom"><h:outputText value="#{accountdata.profileID}" /></td>
                        <td valign="bottom"></td>
                        <td align="right" valign="bottom"><a href="docs/glossary.html">total
                        logouts: </a></td>
                        <td valign="bottom"><h:outputText value="#{accountdata.logoutCount}" /></td>
                        <td valign="bottom"></td>
                        <td valign="bottom" align="right"><a href="docs/glossary.html">opening
                        balance: </a></td>
                        <td valign="bottom"><h:outputText value="#{accountdata.openBalance}" /></td>
                    </tr>
                    <tr>
                        <td colspan="8"></td>
                    </tr>
                </tbody>
            </table>
            <table width="100%">
                <tbody>

                    <tr>
                        <td colspan="5" bgcolor="#cccccc"><b>Total Orders: </b></td>
                        <td bgcolor="#cccccc" align="right"><b>
                        <a href="app?action=account&amp;showAllOrders=true">show all orders</a></b></td>
                    </tr>
                    <tr align="center">
                        <td colspan="6">
                        <h:dataTable id="orders" value="#{accountdata.allOrders}" var="item">
        <f:facet name="header">
            <h:outputText value="Recent Orders" color="#ff0000" />
        </f:facet>

        <h:column>
            <f:facet name="header">
                <h:outputText value="order id" />
            </f:facet>
            <h:outputText value="#{item.orderID}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="order status" />
            </f:facet>
            <h:outputText value="#{item.orderStatus}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="creation date" />
            </f:facet>
            <h:outputText value="#{item.openDate}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="completion date" />
            </f:facet>
            <h:outputText value="#{item.completionDate}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="txn fee" />
            </f:facet>
            <h:outputText value="#{item.orderFee}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="type" />
            </f:facet>
            <h:outputText value="#{item.orderType}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="symbol" />
            </f:facet>
            <h:outputText value="#{item.symbol}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="quantity" />
            </f:facet>
            <h:outputText value="#{item.quantity}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="price" />
            </f:facet>
            <h:outputText value="#{item.price}"></h:outputText>
        </h:column>

        <h:column>
            <f:facet name="header">
                <h:outputText value="total" />
            </f:facet>
            <h:outputText value="#{item.total}"></h:outputText>
        </h:column>
    </h:dataTable>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6"></td>
                    </tr>
                </tbody>
            </table>
            
            <table width="100%">
                <tbody>
                    <tr>
                        <td colspan="6" bgcolor="#cccccc"><b>Account Profile</b></td>
                    </tr>
                    <tr>
                        <td align="right" valign="top" width="113"><a
                            href="docs/glossary.html">user ID:</a></td>
                        <td align="left" valign="top" colspan="2" width="228"><h:inputText id="uid" value="#{tradeapp.userID}" required="true" /></td>
                            
                        <td align="right" valign="top" width="73" colspan="2"><a
                            href="docs/glossary.html">full name: </a></td>
                        <td align="left" valign="top"><h:inputText id="fullname" value="#{tradeapp.fullname}"
                readonly="true" /></td>
                    </tr>
                    <tr>
                        <td align="right" width="113"><a href="docs/glossary.html">password:
                        </a></td>
                        <td colspan="2" width="228"><h:inputSecret id="password" value="#{tradeapp.password}"
                required="true">
                <f:validateLength minimum="1" maximum="12" />
            </h:inputSecret></td>
                        <td align="right" width="73" colspan="2"><a
                            href="docs/glossary.html">address: </a></td>
                        <td><h:inputText id="address" value="#{tradeapp.address}" readonly="true" /></td>
                    </tr>
                    <tr>
                        <td align="right" width="113"><a href="docs/glossary.html">confirm
                        password: </a><br/>
                        </td>
                        <td colspan="2" align="left" width="228"><h:inputText id="cpassword" value="#{tradeapp.cpassword}"
                required="true" /></td>
                        <td align="right" width="73" colspan="2"><a
                            href="docs/glossary.html">credit card: </a></td>
                        <td align="left"><h:inputText id="ccn" value="#{tradeapp.ccn}" required="true" ><f:validateLength minimum="1" maximum="30" /></h:inputText></td>
                    </tr>
                    <tr>
                        <td align="right" width="113"><a href="docs/glossary.html">email
                        address: </a></td>
                        <td colspan="2" align="left" width="228">
                        <h:inputText id="email" value="#{tradeapp.email}" required="true" />
                        </td>
                        <td align="right" width="73" colspan="2"></td>
                        <td align="center">
                        <h:commandButton id="submit" type="submit" value="Update Profile" action="#{tradeapp.updateProfile}" /></td>
                    </tr>
                    <tr>
                        <td width="113"></td>
                        <td colspan="5"></td>
                    </tr>
                </tbody>
            </table>
            
            </td>
        </tr>
    </tbody>
</table>
<table height="54" style="font-size: smaller">
    <tbody>
        <tr>
            <td colspan="2">
            <hr/>
            </td>
        </tr>
        <tr>
            <td colspan="2">
            <table width="100%" style="font-size: smaller">
                <tbody>
                    <tr>
                        <td>Note: Click any <a href="docs/glossary.html">symbol</a> for a
                        quote or to trade.</td>
                        <td align="right">
                        <h:commandButton id="submit" type="submit" value="quotes" action="#{quotedata.getQuotesBySymbols}" />
                        <h:inputText id="symbols" value="#{quotedata.symbols}" required="true"><f:validateLength minimum="1" maximum="40" /></h:inputText>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
        <tr>
            <td bgcolor="#c93333" align="left" width="640" height="10"><b><font
                color="#ffffff">DayTrader Account</font></b></td>
            <td align="center" bgcolor="#000000" width="100" height="10"><font
                color="#ffffff"><b>DayTrader</b></font></td>
        </tr>
    </tbody>
</table>
</h:form>
</h:body>
</html>
